Method and apparatus for selectively enhancing an image

ABSTRACT

The present invention provides a method and apparatus for selectively enhancing regions in an image. In one embodiment, a digital image is read from an image source and is converted into a desired image model. One or more regions in the image having intensity values of pixels falling outside a pre-determined optimal intensity range are determined. The one or more regions in the image are then enhanced using a modeled light source of an optimal intensity such that the intensity value of pixels corresponding to the one or more regions in the image fall within the pre-determined optimal intensity range.

RELATED APPLICATION

Benefit is claimed to Indian Provisional Application No. 1986/MUM/2012titled “Image Enhancement” by KPIT Cummins Infosystems Private Limited,filed on 10 Jul. 2012, which is herein incorporated in its entirety byreference for all purposes.

FIELD OF THE INVENTION

The present invention generally relates to the field of imageprocessing, and more particularly relates to a method and apparatus forselectively enhancing an image.

BACKGROUND OF THE INVENTION

With the advent of digital computing, a large number of applicationssuch as automotive, surveillance, and bio metric use digital images andvideos. Some of these applications require that images captured are offinest possible quality. One of the shortcomings in many images capturedusing image capturing devices is that, when a poorly lit scene iscaptured, details in the captured image are lost due to low light areasand/or overly bright areas in the scene. For example, when a light isswitched on in a dark room, a peculiar pattern of illumination isobserved. The intensity of pixels is highest around the light source andgoes on reducing as one moves away from the light source. Similarly, inimages, if a light source is placed at a specific location, pixelsundergo a change in intensity according to a pattern. Consequently, theimages captured have uneven lighting, thereby affecting quality duringprocessing of such images.

SUMMARY OF THE INVENTION

The present invention provides a method and apparatus for selectivelyenhancing regions in an image. In one aspect, a method includesdetermining one or more regions in an image having intensity values ofpixels falling outside a pre-determined optimal intensity range. Themethod further includes enhancing one or more regions in the image usinga modeled light source of an optimal intensity such that the intensityvalue of pixels corresponding to the one or more regions in the imagefall within the pre-determined optimal intensity range.

In another aspect, an apparatus includes a processor, and a memorycoupled to the processor. The memory includes an image enhancementmodule stored in the form of instructions, that when executed theprocessor, cause the processor to perform method steps described above.

In yet another aspect, a non-transitory computer readable storage mediumhaving executable instructions stored therein, that when executed by theprocessor, cause the processor to perform method steps described above.

Other features of the embodiments will be apparent from the accompanyingdrawings and from the detailed description that follows.

BRIEF DESCRIPTION OF THE ACCOMPANYING DRAWINGS

FIG. 1 is a process flowchart illustrating a method of selectivelyenhancing regions in an image, according to one embodiment.

FIG. 2 shows an exemplary image processing device for implementing oneor more embodiments of the present subject matter.

FIG. 3 is a process flowchart illustrating an exemplary method ofbrightening dark regions in an input image, according to one embodiment.

FIG. 4 is a process flowchart illustrating an exemplary method ofsoftening over bright regions in an input image, according to oneembodiment.

FIG. 5A is a pictorial representation depicting an exemplary input imagecontaining dark regions and over bright regions.

FIGS. 5B to 5D is pictorial representations depicting exemplary outputimages containing enhanced dark regions and/or softened bright regions.

FIG. 6A is a pictorial representation depicting another exemplary inputimage containing dark regions and over bright regions.

FIGS. 6B and 6D are pictorial representations depicting anotherexemplary output images containing enhanced dark regions and/or softenedover bright regions respectively.

The drawings described herein are for illustration purposes only and arenot intended to limit the scope of the present disclosure in any way.

DETAILED DESCRIPTION OF THE INVENTION

The present invention provides a method and apparatus for selectivelyenhancing regions in an image. In the following detailed description ofthe embodiments of the invention, reference is made to the accompanyingdrawings that form a part hereof, and in which are shown by way ofillustration specific embodiments in which the invention may bepracticed. These embodiments are described in sufficient detail toenable those skilled in the art to practice the invention, and it is tobe understood that other embodiments may be utilized and that changesmay be made without departing from the scope of the present invention.The following detailed description is, therefore, not to be taken in alimiting sense, and the scope of the present invention is defined onlyby the appended claims.

FIG. 1 is a process flowchart 100 illustrating a method of enhancingregions in an image, according to one embodiment. At step 102, a digitalimage is read from an image source. For example, the image source may bea database storing images. Alternatively, the image source may be animage capturing unit such as a digital camera. At step 104, the digitalimage is converted into a desired image model. For example, the digitalimage is converted into an image model such as grayscale model, RGBmodel, HSI model, CMY model, YUV model, and YIQ model. The image modelto which the image is converted depends on compatibility of processingthe digital image. The light source, according to the invention, isgenerated based on the image model created. The type and color of thelight in the image is determined based on the color of the light and thelight source is modeled, accordingly. It is appreciated that the digitalimage is converted into the desired image model using any imageconversion algorithm well known in the art. If the digital image readfrom the image source is in desired image model, then step 104 isskipped and the process 100 directly routed to step 106.

At step 106, one or more regions in the image having pixels withintensity value falling outside a pre-determined optimal intensity rangeare determined. In one embodiment, one or more regions having intensityvalues of pixels greater than the pre-determined optimal intensity rangeare determined as over bright regions in the image. In anotherembodiment, one or more regions having intensity values of pixels lessthan the pre-determined optimal intensity range are determined as darkregions. According to an example, the pre-determined optimal intensityrange may be having a minimum optimal intensity value of 150 and maximumoptimal intensity value of 170. Thus, for a given image, regionscontaining pixels with intensity value less than 150 are considered asdark regions and regions containing pixels with intensity value greaterthan 170 are considered as bright regions. In some embodiments, theoptimal intensity range for the input image is pre-determined based onaverage total range of intensity values of pixels in the image and basedon application for which the further processing of the image is to beperformed.

At step 108, the one or more regions in the image are enhanced using amodeled light source of an optimal intensity such that the intensityvalue of pixels corresponding to the one or more regions in the imagefall within the pre-determined optimal intensity range. In oneembodiment, the dark regions in the image are brightened using a lightsource of optimal intensity. In another embodiment, the over brightregions in the image are softened using a light source of optimalintensity. It is understood that the light sources used for softeningthe over bright regions and brightening the dark regions may be samelight source or different light sources modeled to enhance the image.The softening effect has similar effect of dimming a light or eventurning it off altogether. At step 110, the enhanced image is outputted.In one embodiment, the enhanced image is outputted in an image modelassociated with the image read from the image source. In anotherembodiment, the enhanced image is outputted in a desired image model.The method steps in identifying and enhancing dark regions and softeningover bright regions in the image is illustrated in FIGS. 3 and 4.

FIG. 2 shows an example of an image processing device 200 forimplementing one or more embodiments of the present subject matter. FIG.2 and the following discussion are intended to provide a brief, generaldescription of the suitable computing environment in which certainembodiments of the inventive concepts contained herein may beimplemented.

The image processing device 200 may include a processor 202, a memory204, a removable storage 206, and a non-removable storage 208. The imageprocessing device 200 additionally includes a bus 210 and a networkinterface 212. The image processing device 200 may include or haveaccess to one or more user input devices 214, one or more output devices216, and one or more communication connections 218. The one or more userinput devices 214 may be keyboard, mouse, and the like. The one or moreoutput devices 216 may be a display. The communication connections 218may include mobile networks such as General Packet Radio Service (GPRS),Wireless Fidelity (Wi-Fi®), Worldwide Interoperability for MicrowaveAccess (WiMax), Long Term Evolution (LTE), and the like.

The memory 204 may include volatile memory and/or non-volatile memoryfor storing computer program 220. A variety of computer-readable storagemedia may be stored in and accessed from the memory elements of theimage processing device 200, the removable storage 206 and thenon-removable storage 208. Computer memory elements may include anysuitable memory device(s) for storing data and machine-readableinstructions, such as read only memory, random access memory, erasableprogrammable read only memory, electrically erasable programmable readonly memory, hard drive, removable media drive for handling memory cardsand the like.

The processor 202, as used herein, means any type of computationalcircuit, such as, but not limited to, a microprocessor, amicrocontroller, a complex instruction set computing microprocessor, areduced instruction set computing microprocessor, a very longinstruction word microprocessor, an explicitly parallel instructioncomputing microprocessor, a graphics processor, a digital signalprocessor, or any other type of processing circuit. The processor 202may also include embedded controllers, such as generic or programmablelogic devices or arrays, application specific integrated circuits,single-chip computers, smart cards, and the like.

Embodiments of the present subject matter may be implemented inconjunction with program modules, including functions, data structures,and application programs, for performing tasks, or defining abstractdata types or low-level hardware contexts. Machine-readable instructionsstored on any of the above-mentioned storage media may be executable bythe processor 202 of the image processing device 200. For example, acomputer program 220 includes an image enhancement module 222 with alight source modeling module 224 and a region enhancement module 226stored in the form of machine readable instructions. Themachine-readable instructions, which when executed by the processor 202,may cause the image processing device 200 to perform steps illustratedin FIGS. 1, 3 and 4 according to the various embodiments of the presentsubject matter.

For example, the light source modeling module 224 causes the processor202 to model a light source of optimal-intensity for brightening darkregions in an image and model a light source of optimal intensity forsoftening over bright regions in the image. Further, the light sourcemodeling module 224 causes the processor 202 to generate a light sourceimage with pixels having intensity value falling within a pre-determinedoptimal intensity range from the respective modeled light source. Theregion enhancement module 226 causes the processor 202 to identify darkand over bright regions in the image and enhance the dark and overbright regions in the image using the respective light source images.

FIG. 3 is a process flowchart 300 illustrating an exemplary method ofbrightening dark regions in an input image, according to one embodiment.At step 302, a grayscale light source image having pixels with intensityvalue falling within a pre-determined optimal intensity range isgenerated for brightening dark regions in an input image. In someembodiments, a light source of optimal intensity is modeled forbrightening dark regions in the input image. In these embodiments, thelight source image is generated by rotating and merging the modeledlight source. In one exemplary implementation, the light source ismodeled using the following equation:

S(y,x)=k*exp(−λ*(r/R)),

where,

R=(S1² +S2²)^(0.5)

and

r=((x+offx)²)+((y+offy)²)^(0.5),

where, k and λ are constants which are determined experimentally, S1 andS2 are size of light source model, x varies from 1 to S1 and y variesfrom 1 to S2, offx is an offset value of x and offy is offset value ofy. The offx and offy are co-ordinate values in the image from wherescanning of the image need to begin to identify dark region(s) in theimage. In an example, as the entire image is scanned for identifying thedark region(s), the values of offx and offy are set to 0 so as to beginscanning of the image from the origin. For certain applications, thescanning for the dark region(s) not need begin at the origin (0,0) butaway from the origin (0,0). In such case, the offset values offx andoffy may have coordinate values corresponding to the point wherescanning of the dark region(s) has started.

At step 304, the input image (as shown in FIG. 5A) is converted into adesired image model. At step 306, a pixel(s) having minimum intensityvalue in the image is determined. At step 308, mean value of the pixelsin the image is computed based on the minimum intensity value of thepixel(s) in the image. At step 310, it is determined whether the meanvalue of the pixels in the image is less than a first pre-determinedthreshold value. The first pre-determined threshold value corresponds tothe minimum value of the pre-determined optimal intensity range. If themean value of pixels is less than the first pre-determined thresholdvalue, then at step 312, the image is divided into a plurality ofregions. At step 314, mean value of pixels in each of the regions iscomputed.

At step 316, minimum mean value of pixels corresponding to at least oneof the regions is determined from the mean values computed for theregions. At step 318, it is determined whether the minimum mean value ofthe pixels corresponding to at least one region is less than the firstpre-determined threshold value. If the minimum mean value is less thanthreshold value, then at step 320, the at least one of the regions isidentified as a dark region in the image. At step 322, coordinatescorresponding to the at least one region identified as dark region aredetermined. At step 324, the pixels corresponding to the at least oneregion having intensity value less than the first pre-determinedthreshold value are replaced with the pixels of the light source imagehaving optimal intensity value based on the coordinates corresponding tothe at least one region such that intensity value of the replaced pixelsin the at least one region fall within the pre-determined optimalintensity range. In some embodiments, the pixels corresponding to the atleast one region having intensity value less than the firstpre-determined threshold value are replaced with the light source imageby superimposing the light source image on the at least one region,where the size of the light source image is equal to the size of the atleast one region.

At step 326, it is determined whether all pixels in the enhanced imageare having intensity value falling within optimal intensity range. If itis determined that all the pixels in the enhanced image are havingintensity value falling within optimal intensity range, then step 330 isperformed. If it is determined that the pixels in the image are havingintensity value falling outside the pre-determined optimal intensityrange, then at step 328, it is determined whether a pre-determinednumber of iterations for enhancing the image are completed. If thepre-determined number of iterations is not completed, then the steps 306to 326 repeated till all the dark regions in the image are enhanced. Ifthe predetermined number of iterations is performed, then step 330 isperformed. At the step 330, the enhanced image is outputted on theoutput device 216. An exemplary enhanced digital image is illustrated inFIG. 5B.

FIG. 4 is a process flowchart 400 illustrating an exemplary method forsoftening over bright regions in an input image, according to oneembodiment. At step 402, a grayscale light source image with pixelshaving intensity value falling within a pre-determined optimal intensityrange is generated for softening over bright regions in an input image.In some embodiments, a light source of optimal intensity is modeled forsoftening over bright regions in the input image. In these embodiments,the light source image is generated by rotating and merging the modeledlight source. In one exemplary implementation, the light source ismodeled using the following equation:

S(y,x)=k*exp(−λ*(r/R)),

where, R=(S1²+S2²)^(0.44), r=((x+offx)²)+((y+offy)²)^(0.7), k and λ areconstants which are determined experimentally, S1 and S2 are size oflight source model, x varies from 1 to S1 and y varies from 1 to S2,offx is an offset value of x and offy is offset value of y. The offx andoffy are co-ordinate values in the image from where scanning of theimage need to begin to identify over bright region(s) in the image. Inan example, as the entire image is scanned for identifying over-brightregion(s), the values of offx and offy are set to 0 so as to beginscanning of the image from the origin. For certain applications, thescanning for the over bright region(s) not need begin at the origin(0,0) but away from the origin (0,0). In such case, the offset valuesoffx and offy may have coordinate values corresponding to the pointwhere scanning of the over bright region(s) has started.

At step 404, the input image (as shown in FIG. 5A) is converted into adesired image model. At step 406, pixels in the image with intensityvalue greater than a second pre-determined threshold value areidentified as over bright regions. The second pre-determined thresholdvalue is the maximum value of the pre-determined optimal intensityrange. At step 408, it is determined whether the identified pixelscorrespond to at least one lighting means (e.g., street light, a headlight, camera flash, etc.) in a scene captured in the image based onsize and shape of the determined pixels. Usually, the shape of emissionof light from any lighting means is circular. So, if the identifiedpixels are of circular shape, then the identified pixels may beconsidered as corresponding to a lighting means. Further, based on thesize of the identified pixels corresponding to the lighting means, itcan be determined whether the lighting means is located at a far offdistance or close by with respect to an image capturing device. Thus,depending on the shape and size of the determined pixels, a decision ismade as whether to treat the determined pixels as corresponding to alighting means that has resulted in over bright regions and whether tosoften the over bright regions or not as described below.

If the pixels correspond to the lighting means, then at step 410, thepixels corresponding to the lighting means are replaced with the pixelsof the light source image such that intensity value of the replacedpixels fall within the pre-determined optimal intensity range. In someembodiments, the pixels corresponding to the lighting means are replacedwith the pixels of the light source image by superimposing the lightsource image onto one or more regions encompassing the pixels whichcorrespond to the lighting means, where the size of the light sourceimage may be equal to the size of the over bright regions. At the step412, the enhanced image is outputted on the output device 216. Anexemplary enhanced digital image is shown in FIG. 5C. It is understoodthat, the process 300 of brightening dark regions and the process 400 ofsoftening over bright regions in the image can be performedsimultaneously or separately.

FIG. 5A is a pictorial representation depicting an exemplary input image500 containing dark regions 602 and over bright region 604. Thepictorial representation in FIG. 5A depicts an input image 500 havingdark regions 502 and over bright region 504. It can be seen that apedestrians 506 are not clearly visible due to presence of dark regions502 and over bright region 504 in the input image 500. According to thepresent disclosure, the image processing device 200 scans the inputimage 500 and identifies the dark regions 502 and over bright region 504having intensity value of pixels falling outside a desired optimalintensity range using the region enhancement module 226.

Also, the image processing device 200 generates a light source image bymodeling a light source with pixels of optimal intensity value desiredfor further processing the image 500 using the light source modelingmodule 224. For example, the image processing device 200 generates alight source image for brightening the dark regions 502 in the image 500and another light source image for softening the over bright region 504in the input image 500. Thereafter, the image processing device 500generates an output image with the enhanced dark region 527 and softenedover bright region 552 by superimposing the respective light sourceimage on the dark region 502 and the over bright region 504 using theregion enhancement module 226. FIG. 5B is a pictorial representationdepicting an exemplary output image 525 containing enhanced dark regions527. FIG. 5C is a pictorial representation depicting an exemplary outputimage 550 containing softened over bright region 552. FIG. 5D is apictorial representation depicting an exemplary output image 575containing enhanced dark regions 527 and softened over bright region552. It can be seen that now, after modeling of the light source in darkregions and softening the over-bright regions in the image, thepedestrians 506 are clearly visible in the output images 525, 550 and575, which were not clearly visible in the input image 500.

FIG. 6A is a pictorial representation depicting another exemplary inputimage 600 containing dark regions 602 and over bright region 604. FIG.6B is a pictorial representation depicting an exemplary output image 625containing enhanced dark regions 627. FIG. 6C is a pictorialrepresentation depicting an exemplary output image 650 containingsoftened over bright region 652. FIG. 6D is a pictorial representationdepicting an exemplary output image 675 containing enhanced dark regions627 and softened over bright region 652.

The present embodiments have been described with reference to specificexample embodiments; it will be evident that various modifications andchanges may be made to these embodiments without departing from thebroader spirit and scope of the various embodiments. Furthermore, thevarious devices, modules, and the like described herein may be enabledand operated using hardware circuitry, for example, complementary metaloxide semiconductor based logic circuitry, firmware, software and/or anycombination of hardware, firmware, and/or software embodied in a machinereadable medium. For example, the various electrical structure andmethods may be embodied using transistors, logic gates, and electricalcircuits, such as application specific integrated circuit. The valuesprovided are to be considered in an exemplary manner only and it is tobe understood that they could vary based on the requirements and theapplications.

1-29. (canceled)
 30. A method of selectively enhancing regions in animage, comprising: determining one or more regions in the image havingpixels with an intensity value falling outside a desired intensityrange; and enhancing the one or more regions in the image using a lightsource image having pixels with a desired intensity value.
 31. Themethod of claim 30, further comprising generating the light source imagefor brightening one or more dark regions in the image.
 32. The method ofclaim 31, wherein generating the light source image for brightening thedark regions in the image comprises: modeling a light source of thedesired intensity value for brightening the dark regions in the image;and generating the light source image using the modeled light source.33. The method of claim 32, wherein determining the one or more regionsin the image having pixels with the intensity value falling outside thedesired intensity range comprises: (a) determining at least one pixelhaving a lowest intensity value from the pixels in the image; (b)computing a first mean value of the pixels in the image based on thelowest intensity value of the at least one pixel; (c) determiningwhether the first mean value of the pixels in the image is less than athreshold value; after the steps (a) to (c), and in response todetermining the first mean value of the pixels in the image is less thanthe threshold value, performing the following steps: (d) dividing theimage into a plurality of regions; (e) computing a second mean value ofpixels in each of the plurality of regions; (f) determining a minimummean value of pixels corresponding to at least one of the plurality ofregions from the second mean values of the plurality of regions; (g)determining whether the minimum mean value of the pixels correspondingto said at least one of the plurality of regions is less than thethreshold value; (h) identifying said at least one of the plurality ofregions in the image as a dark region if the minimum mean value of thepixels corresponding to said at least one of the plurality of regions isless than the threshold value, wherein enhancing the one or more regionsin the image comprises enhancing the identified dark region; and (i)repeating the steps (a) to (h) until all the dark regions in the imageare enhanced.
 34. The method of claim 33, wherein enhancing the one ormore regions in the image using the light source image having pixelswith the desired intensity value comprises replacing the pixels in atleast one dark region of the image with the pixels of the light sourceimage.
 35. The method of claim 34, wherein replacing the pixels in theat least one dark region of the image with the pixels of the lightsource image comprises superimposing the light source image onto the atleast one dark region in the image.
 36. The method of claim 30, furthercomprising generating the light source image for softening brightregions in the image.
 37. The method of claim 36, wherein generating thelight source image for softening the bright regions in the imagecomprises: modeling a light source for softening one or more brightregions in the image; and generating the light source image using themodeled light source.
 38. The method of claim 37, wherein determiningthe one or more regions in the image having pixels with the intensityvalue falling outside the desired intensity range comprises: determiningpixels in the image with intensity value greater than a threshold value;and determining whether the determined pixels correspond to a firstlight source in the image based on size and shape of one or more regionsencompassing the determined pixels.
 39. The method of claim 38, whereinenhancing the one or more regions in the image using the light sourceimage having pixels with the desired intensity value comprises replacingthe pixels corresponding to the first light source with the pixels ofthe light source image.
 40. The method of claim 39, wherein replacingthe pixels corresponding to the first light source in the image with thepixels of the light source image comprises superimposing the lightsource image onto the one or more regions encompassing the pixelscorresponding to the first light source in the image.
 41. The method ofclaim 30, further comprising converting the image in a desired imagemodel.
 42. The method of claim 41, wherein the desired image model isselected from the group consisting of a grayscale image model, an RGBimage model, a HSI image model, a CMY image model, a YIQ image model,and a YUV image model.
 43. An apparatus comprising: a processor; and amemory coupled to the processor, wherein the memory comprises an imageenhancement module stored in the form of instructions that, whenexecuted the processor, cause the processor to: determine one or moreregions in an image having pixels with an intensity value fallingoutside a desired intensity range; and enhance the one or more regionsin the image using a light source image having pixels with a desiredintensity value.
 44. The apparatus of claim 43, wherein the imageenhancement module causes the processor to generate the light sourceimage for brightening one or more dark regions in the image.
 45. Theapparatus of claim 44, wherein in determining the one or more regions inthe image having pixels with intensity value falling outside the desiredintensity range, the image enhancement module causes the processor to:(a) determine at least one pixel having a lowest intensity value fromthe pixels in the image; (b) compute a first mean value of the pixels inthe image based on the lowest intensity value of the at least one pixel;(c) determine whether the first mean value of the pixels in the image isless than a threshold value; after the steps (a) to (c), and in responseto determining the first mean value of the pixels in the image is lessthan the threshold value, perform the following steps: (d) divide theimage into a plurality of regions; (e) compute a second mean value ofpixels in each of the plurality of regions; (f) determine a minimum meanvalue of pixels corresponding to at least one of the plurality ofregions from the second mean values of the plurality of regions; (g)determine whether the minimum mean value of the pixels corresponding tosaid at least one of the plurality of regions is less than the firstthreshold value; (h) identify said at least one of the plurality ofregions in the image as a dark region if the minimum mean value of thepixels corresponding to said at least one of the plurality of regions isless than the threshold value, wherein the processor is configured toenhance the one or more regions in the image by enhancing the identifieddark region; and (i) repeat the steps (a) to (h) until all the darkregions in the image are enhanced.
 46. The apparatus of claim 45,wherein in enhancing the one or more regions in the image using thelight source image having pixels with the desired intensity value, theimage enhancement module cause the processor to replace the pixels in atleast one dark region of the image with the pixels of the light sourceimage.
 47. The apparatus of claim 43, wherein the image enhancementmodule cause the processor to generate the light source image forsoftening bright regions in the image.
 48. The apparatus of claim 47,wherein in determining the one or more regions in the image havingpixels with the intensity value falling outside the desired intensityrange, the image enhancement module cause the processor to: determinepixels in the image with intensity value greater than a threshold value;and determine whether the determined pixels correspond to a first lightsource in the image based on size and shape of one or more regionsencompassing the determined pixels.
 49. The apparatus of claim 48,wherein in enhancing the one or more regions in the image using thelight source image having pixels with the desired intensity value,wherein the image enhancement module cause the processor to replace thepixels corresponding to the first light source with the pixels of thelight source image.
 50. The apparatus of claim 43, wherein the imageenhancement module cause the processor to convert the image in a desiredimage model.
 51. The apparatus of claim 50, wherein the desired imagemodel is selected from the group consisting of a grayscale image model,an RGB image model, a HSI image model, a CMY image model, a YIQ imagemodel, and a YUV image model.
 52. A non-transitory computer readablestorage medium having executable instructions stored therein, that whenexecuted by the processor, cause the processor to perform operationscomprising: determining one or more regions in an image having pixelswith an intensity value falling outside a desired intensity range; andenhancing the one or more regions in the image using a light sourceimage having pixels with a desired intensity value.
 53. The storagemedium of claim 52, wherein the operations further comprise generatingthe light source image for brightening one or more dark regions in theimage.
 54. The storage medium of claim 53, wherein in determining theone or more regions in the image having pixels with intensity valuefalling outside the desired intensity range, the operations furthercomprise: (a) determining at least one pixel having a lowest intensityvalue from the pixels in the image; (b) computing a first mean value ofthe pixels in the image based on the lowest intensity value of the atleast one pixel; (c) determining whether the first mean value of thepixels in the image is less than a first threshold value; after thesteps (a) to (c), and in response to determining the first mean value ofthe pixels in the image is less than the threshold value, performing thefollowing steps: (d) dividing the image into a plurality of regions; (e)computing a second mean value of pixels in each of the plurality ofregions; (f) determining a minimum mean value of pixels corresponding toat least one of the plurality of regions from the second mean values ofthe plurality of regions; (g) determining whether the minimum mean valueof the pixels corresponding to said at least one of the plurality ofregions is less than the first threshold value; (h) identifying said atleast one of the plurality of regions in the image as a dark region ifthe minimum mean value of the pixels corresponding to said at least oneof the plurality of regions is less than the first threshold value,wherein enhancing the one or more regions in the image comprisesenhancing the identified dark region; and (i) repeating the steps (a) to(h) until all the dark regions in the image are enhanced.
 55. Thestorage medium of claim 54, wherein in enhancing the one or more regionsin the image using the light source image having pixels with the desiredintensity value, the operations further comprise replacing the pixels inat least one dark region of the image with the pixels of the lightsource image.
 56. The storage medium of claim 55, wherein the operationsfurther comprise generating the light source image for softening brightregions in the image.
 57. The storage medium of claim 56, wherein indetermining the one or more regions in the image having pixels with theintensity value falling outside the desired intensity range, theoperations further comprise: determining pixels in the image withintensity value greater than a second threshold value; and determiningwhether the determined pixels correspond to a first light source in theimage based on size and shape of one or more regions encompassing thedetermined pixels.
 58. The storage medium of claim 57, wherein inenhancing the one or more regions in the image using the light sourceimage having pixels with the desired intensity value, the operationsfurther comprise replacing the pixels corresponding to the first lightsource with the pixels of the light source image.